<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Validator;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Validator::extend('telephone', function($attribute, $value, $parameters){
            return preg_match( config( 'regex.telephone' ), $value );
        });
        Validator::extend('devicecode', function($attribute, $value, $parameters){
            return preg_match( config( 'regex.devicecode' ), $value );
        });
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
